package com.tian.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.tian.entity.CarAreaModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * {@code @description:} TODO
 *
 * @author tianwc 公众号：Java后端技术全栈
 * 在线刷题 1200+java面试题和1000+篇技术文章：<a href="https://woaijava.cc/">博客地址</a>
 * {@code @date:} 2024-03-26 11:25
 * {@code @version:} 1.0
 */
public class CarAreaUtil {

    /**
     * 读取JSON文件
     */
   /* public List<CarAreaModel> getCarAreaJSON() throws IOException {
        InputStream inputStream = getClass().getResourceAsStream("/json/carArea.json");
        if (inputStream == null) {
            throw new RuntimeException("读取车牌归属地json文件失败！！！");
        } else {
            JSONObject json = JSON.parseObject(inputStream, JSONObject.class);
            JSONArray array = json.getJSONArray("codeInfo");
            return array.toJavaList(CarAreaModel.class);
        }
    }*/
}
